﻿Imports Microsoft.VisualBasic
Imports System.Data

REM 此类用于通用类系统的配置
Public Class ClsBase
    Protected Shared mErrMessage As String

    ' 声明区

    REM 返回类错误信息,只读
    Public Shared ReadOnly Property ErrMessage() As String
        Get
            Return mErrMessage
        End Get
    End Property

    Public Shared ReadOnly Property HasError() As Boolean
        Get
            Return Not String.IsNullOrEmpty(mErrMessage)
        End Get
    End Property

    REM 设定WebConfig配置信息的读取的属性
    Protected Shared Property AppSettings(ByVal fKey As String) As String
        Get
            Dim RtnString As String = System.Configuration.ConfigurationManager.AppSettings.Item(fKey)
            If String.IsNullOrEmpty(RtnString) Then
                Return String.Empty
            Else
                Return RtnString
            End If
        End Get
        Set(ByVal value As String)
            System.Configuration.ConfigurationManager.AppSettings.Item(fKey) = value
        End Set
    End Property

    Protected Overrides Sub Finalize()
        MyBase.Finalize()
    End Sub


End Class

